//
// Created by yyl on 2018/6/6.
//

#ifndef MYMUSIC_YQUEUE_H
#define MYMUSIC_YQUEUE_H

#include "yyl_log.h"
#include "queue"
#include "PlayStatus.h"

extern "C" {
#include "libavcodec/avcodec.h"
};

class YQueue {
public:
    std::queue<AVPacket *> queuePacket;
    //
    pthread_mutex_t mutexPacket;//条件锁
    pthread_cond_t condPacket;//条件变量

    PlayStatus *playStatus = NULL;

public:
    YQueue(PlayStatus *playStatus);

    ~YQueue();

    int putAvpacket(AVPacket *packet);

    int getAvpacket(AVPacket *packet);

    int getQueueSize();

    void clearAvPacket();

    void release();
};


#endif //MYMUSIC_YQUEUE_H
